{% extends "base.html" %}

{% block title %}编辑用户{% endblock %}

{% block content %}
<h2>编辑用户</h2>
<form method="POST">
    <div class="mb-3">
        <label for="username" class="form-label">用户名</label>
        <input type="text" class="form-control" id="username" name="username" value="{{ user.username }}" required>
    </div>
    <div class="mb-3">
        <label for="password" class="form-label">密码</label>
        <input type="password" class="form-control" id="password" name="password" required>
    </div>
    <div class="mb-3 form-check">
        <input type="checkbox" class="form-check-input" id="is_admin" name="is_admin" {% if user.is_admin %}checked{% endif %}>
        <label class="form-check-label" for="is_admin">管理员</label>
    </div>
    <button type="submit" class="btn btn-primary">保存</button>
</form>
{% endblock %}
